// components/Search/Search.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    themeColor: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isSign: false,
    day: new Date().getDate(),
  },
  attached () {
    let signDay = wx.getStorageSync('signToday')
    if (signDay && this.data.day == signDay) {
      this.setData({
        isSign: true,
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    sign() {
      wx.setStorageSync('signToday', this.data.day)
      wx.showToast({
        title: '签到成功',
        icon:'none'
      })
      this.setData({
        isSign:true
      })
    }
  }
})
